<?php
namespace Rate\Controller;
use Todo\Controller\ApiController;

class NormController extends ApiController {

    //过滤查询条件
    protected function _filter(&$where){
        $keywords = I('request.keywords/s');
        if($keywords) $where['title'] = array('like', '%'.$keywords.'%');

        //项目指标
        $proId = I('param.project_id/d');
        if($proId) {
            $info = D('Todo/Rate/Project')->keyFind($proId);
            if($info) $where['tpl_id'] = $info['tpl_id'];
        }
    }
}